package hmac

import (
	"crypto/hmac"
	"crypto/sha1"
	"crypto/sha256"
	"crypto/sha512"

	"gitee.com/injoyai/goutil/crypt"
)

func Sha256(str string, secret string) string {
	return crypt.New(hmac.New(sha256.New, []byte(secret))).EncryptHexBase64(str)
}

func Sha1(str string, secret string) string {
	return crypt.New(hmac.New(sha1.New, []byte(secret))).EncryptHexBase64(str)
}

func Sha512(str string, secret string) string {
	return crypt.New(hmac.New(sha512.New, []byte(secret))).EncryptHexBase64(str)
}
